home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programmierung
/
Power-Programmierung (Tewi)(1994).iso
/
mutt
/
init.mut
< prev
next >
Wrap
Lisp/Scheme
|
1988-10-05
|
5KB
|
148 lines
;; init.mut - The ME initialization file
;; C Durland
(defun
center-cursor { (arg-prefix 0)(reposition-window) }
CR->CR&indent
{
(bind-to-key "newline-and-indent" "^M")
(msg "CR mapped to newline-and-indent")
}
CR->CR { (bind-to-key "newline" "") (msg "CR mapped to newline") }
delete-line { (beginning-of-line)(arg-prefix 1)(kill-line) }
insert-line { (beginning-of-line)(open-line) }
mark-and-end { (set-mark)(end-of-buffer) }
mark-and-home { (set-mark)(beginning-of-buffer) }
visit-a-file { (ask-user)(visit-file)(delete-other-windows) }
delete-current-window
{ (if (not (delete-window -1)) (msg "Could not delete window")) }
describe-key ; what is a key bound to
{
(string key 10 bind 80)
(key (ask "Key: "))
(if (== "" (bind (key-bound-to key)))(msg key " is not bound.")
(msg key " is bound to " bind))
}
rename-buffer
{
(string name 200)
(name (ask "New file name for buffer: "))
(if (not (file-name -1 name)) (msg "Could not rename buffer."))
}
not-modified { (buffer-modified -1 FALSE) }
)
(const REG 0)
(defun ;; rectangle commands
copy-rect { (copy-rectangle REG) }
cut-rect { (copy-rectangle REG) (erase-rectangle TRUE) }
erase-rect { (erase-rectangle TRUE) }
clear-rect { (erase-rectangle FALSE) }
)
(include pmatch.mut) ; paren matching
(include indent.mut) ; shift a region right or left
(include markring.mut) ; a ring of marks
(include sysvar.mut) ; allow user to view or modify system vars
(include nextfile.mut) ; read next file from command line
(include bstats.mut) ; buffer stats
(include isearch.mut) ; incremental search
(include twiddle.mut) ; transpose characters
(include killbuf.mut) ; an "improved" kill-buffer
(include nomunge.mut) ; read only mode for a buffer
(include wspace.mut)
(include autoload.mut)
(defun
adjust-lines { (autoload "adjust-lines" "adjust.mut" (push-args 0)) }
calculator { (autoload "calculator" "calc.mut") }
c-mode { (autoload "c-mode" "cmode.mut") }
mutt-mode { (autoload "mutt-mode" "muttmode.mut") }
text-mode { (autoload "text-mode" "textmode.mut") }
pu { (autoload "pu" "dir.mut") }
cd { (autoload "cd" "dir.mut") }
pwd { (autoload "pwd" "dir.mut") }
edit-picture { (autoload "edit-picture" "picture.mut") }
)
(defun set-mode (string filename) HIDDEN
{
(if (RE-string '.+\(\.[a-zA-Z]+\)' filename)
{
(switch (get-matched '\1')
".c" (floc "c-mode" ())
".h" (floc "c-mode" ())
".mut" (floc "mutt-mode" ())
".doc" (floc "text-mode" ())
".txt" (floc "text-mode" ())
)
})
})
(defun buffer-created-hook
{
(init-markring)
(set-mode (buffer-name -1))
})
(defun MAIN ; and now the init time code
{
(msg "loading init file ...")
(HELP 0) ; I don't need no steenking help
; set up the soft keys if the terminal type is known
; (switch (getenv "TERM")
; "xterm" (load "xterm")
; "vt100" (load "xterm")
; )
; (modify-syntax-entry "w-") ; a dash is part of a word
; get rid of some keys I don't like
; (bind-to-key "" "^W")(bind-to-key "kill-region" "M-C-W")
; (bind-to-key "calculator" "C-C")
(bind-to-key "kill-whitespace" "F-1") ; F1
(bind-to-key "next-buffer" "F-2") ; F2
(bind-to-key "delete-line" "F-5") ; F5
(bind-to-key "p-match" "F-6") ; F6 in pmatch.mut
(bind-to-key "CR->CR&indent" "F-7") ; F7
(bind-to-key "CR->CR" "F-8") ; F8
(bind-to-key "set-mark" "F-0") ; F10
(bind-to-key "center-cursor" "F-G") ; insert key
(bind-to-key "mark-and-end" "F-B") ; end key
(bind-to-key "mark-and-home" "F-A") ; home key
(bind-to-key "isearch-forward" "^S") ; in isearch.mut
(bind-to-key "isearch-reverse" "^R") ; in isearch.mut
(bind-to-key "twiddle-left-of-dot" "C-T") ; in twiddle.mut
(bind-to-key "next-file" "^XF") ; in nextfile.mut
(bind-to-key "push-mark" "F-9") ; in markring.mut
(bind-to-key "push-mark" "M-^P") ; in markring.mut
(bind-to-key "pop-mark" "M-P") ; in markring.mut
(bind-to-key "scroll-up" "M-Z")
(bind-to-key "scroll-down" "C-Z")
(bind-to-key "visit-a-file" "^X^V")
(bind-to-key "re-query-replace" "M-^Q")
(bind-to-key "re-search-forward" "M-S")
(bind-to-key "re-search-reverse" "M-R")
(bind-to-key "delete-current-window" "^X0")
(bind-to-key "list-buffers" "^X^B") ; in bstats.mut
(bind-to-key "show-buffer-stats" "^X=") ; in bstats.mut
(arg-prefix 1)(load "mext") ; load local ME extensions
(msg "init file loaded")
(update)
(next-file)(kill-buffer "*scratch*")
})